package cn.stylefeng.guns.config;

import com.guichaguri.minimalftp.FTPServer;
import com.guichaguri.minimalftp.impl.NativeFileSystem;
import com.guichaguri.minimalftp.impl.NoOpAuthenticator;

import java.io.File;

/**
 * @author eric xu
 * @date 2020/11/15
 * @description
 */
public class TestFtp {
    public static void main(String[] args) throws Exception{
// Uses the current working directory as the root
        File root = new File(System.getProperty("user.dir"));

// Creates a native file system
        NativeFileSystem fs = new NativeFileSystem(root);

// Creates a noop authenticator, which allows anonymous authentication
        NoOpAuthenticator auth = new NoOpAuthenticator(fs);

// Creates the server with the authenticator
        FTPServer server = new FTPServer(auth);

// Start listening synchronously
        server.listenSync(21);
    }
}
